@isTest
private class ClockInOutRESTTest {
    static testMethod void testMethod1() {
    	
		TestUtils.createUsers();
        User acc = [SELECT Id,Name FROM User WHERE Name = '用户1'];

		ClockInOutHistory__c coh1 = new ClockInOutHistory__c(ClockInTime__c=Datetime.valueOf('2016-12-22 08:00:28'), ClockOutTime__c=Datetime.valueOf('2016-12-22 08:52:02'), User__c=acc.Id);
		ClockInOutHistory__c coh2 = new ClockInOutHistory__c(ClockInTime__c=Datetime.valueOf('2017-01-09 01:12:25'), ClockOutTime__c=Datetime.valueOf('2017-01-09 07:12:42'), User__c=acc.Id);
		insert(new List<ClockInOutHistory__c>{coh1,coh2});

		Test.startTest();

		//测试
		Map<String,String> args = new Map<String,String>();
		ClockInOutREST.getClockInOutREST(args);
		
		args.put('data', '');
		ClockInOutREST.getClockInOutREST(args);
		
		args.clear();
		args.put('ts', '20df-01-01 08:03:01');
		ClockInOutREST.getClockInOutREST(args);

		args.clear();
		args.put('rss', '2016-01-01 08:03:01');
		ClockInOutREST.getClockInOutREST(args);
		
		args.clear();
		args.put('ts', '2016-01-01 00:00:00');
		ClockInOutREST.getClockInOutREST(args);
		
		args.clear();
		args.put('ts', '2016-10-01 00:00:00');
		ClockInOutREST.getClockInOutREST(args);

		args.clear();
		args.put('ts', '2016-12-25 00:00:00');
		ClockInOutREST.getClockInOutREST(args);


		Test.stopTest();
	}
}